-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(axis): small multiples axis improvements #1004
Conversation
- Add panel axis for sm chart with own style - Add title prop to GroupBy for formatting sm titles by panel - DRY up repeated types - Simplify title dimensioning logic - Fix check for sm with single bucket - Fix bug with sm value of zero
- Add options to grid story - Hide title when non is defined or empty string
50410cd
to
8bdeb19
Compare
Codecov Report
@@ Coverage Diff @@
## master #1004 +/- ##
==========================================
- Coverage 72.48% 72.11% -0.38%
==========================================
Files 353 371 +18
Lines 11063 10776 -287
Branches 2419 2221 -198
==========================================
- Hits 8019 7771 -248
+ Misses 3029 2904 -125
- Partials 15 101 +86
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Good additions and improvements here!
It refers to a single text label only, ie. not a full axis, so no line, ticks and tick values, correct? Though I guess the per row category labels can be seen as tick values of the outside axis Related: it'd be neat to have a knob for toggling the |
Not sure if I fully understand your question but I think yes. It treats the
Great idea! I forgot to add some vrt for this. I'll do that now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! A couple of smaller optional changes linked to rows
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left few comments, in particular I'd like to discuss the title
prop
src/specs/group_by.ts
Outdated
* If both axis title and this value are set, the axis title will be | ||
* treated as the primary title and this as the secondary. | ||
*/ | ||
title?: GroupByTitleFormatter; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The GroupBy
component is a general component and it can be reused for much more than just creating small multiples.
The title
prop implies that some text will be rendered somewhere.
I prefer something like lookup
or format
that describes an action we are doing to each of the aggregated keys.
Also we should be carefully describe when this formatting take place: before the sorting or after that, because it can really change the way sorting works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<Axis id="time" title="metric" position={Position.Bottom} gridLine={{ visible: false }} /> | ||
<Axis id="y" title="Day of week" position={Position.Left} gridLine={{ visible: false }} /> | ||
<Axis id="time" position={Position.Bottom} gridLine={{ visible: false }} /> | ||
<Axis id="y" title="Day of week" position={Position.Right} gridLine={{ visible: false }} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we go back to the Left position? bar charts should always have a baseline
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# [24.6.0](v24.5.1...v24.6.0) (2021-02-15) ### Bug Fixes * **legend:** width with scroll bar ([#1019](#1019)) ([45bd0d5](45bd0d5)) ### Features * sort values in actions by closest to cursor ([#1023](#1023)) ([e1da4e5](e1da4e5)) * **axis:** small multiples axis improvements ([#1004](#1004)) ([514466f](514466f)) * **partition:** drilldown ([#995](#995)) ([20bbdae](20bbdae))
🎉 This PR is included in version 24.6.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
# [24.6.0](elastic/elastic-charts@v24.5.1...v24.6.0) (2021-02-15) ### Bug Fixes * **legend:** width with scroll bar ([opensearch-project#1019](elastic/elastic-charts#1019)) ([3f9c858](elastic/elastic-charts@3f9c858)) ### Features * sort values in actions by closest to cursor ([opensearch-project#1023](elastic/elastic-charts#1023)) ([4f99c63](elastic/elastic-charts@4f99c63)) * **axis:** small multiples axis improvements ([opensearch-project#1004](elastic/elastic-charts#1004)) ([5896cfa](elastic/elastic-charts@5896cfa)) * **partition:** drilldown ([opensearch-project#995](elastic/elastic-charts#995)) ([de0cba6](elastic/elastic-charts@de0cba6))
Summary
fixes #985, fixes #986
Related to #891
This PR adds functionality around the axis for small multiples including the following...
Axis.title
AxisPanelTitle
secondary
) axessmV
orsmH
value would not render the series correctly.Demo
Checklist
src/index.ts
(and stories only import from../src
except for test data & storybook)